package com.example.book_springboot.service.servceimpl;

import com.example.book_springboot.mapper.BookMapper;
import com.example.book_springboot.pojo.Book;
import com.example.book_springboot.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {
    //依赖注入
    @Autowired
    BookMapper bookMapper;

    @Override
    public List<Book> findGetBookLostAll(){
        return bookMapper.getBooklastAll();
    }

    @Override
    public List<Book> findGetBookByBookName(String bookName){
        return bookMapper.getBookByBookName(bookName);
    }

    @Override
    public int findAddBook(Book book){
        return bookMapper.addBook(book);
    }

    @Override
    public Integer findDelBook(Integer bookId){
        return bookMapper.delBook(bookId);
    }

    @Override
    public Book findGetBookById(String bookId){
        return bookMapper.getBookById(bookId);
    }

    @Override
    public int findUpdateBook(Book book){
        return bookMapper.updateBook(book);
    }

}
